<?php 
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
$act=$_GET['act'];
$wzxx_title ='编辑信息-'.$wzxx_title.'';
$wzxx_gj    ='编辑信息-'.$wzxx_gj.'';
$wzxx_ms    ='编辑信息-'.$wzxx_ms.'';
if(!$user_uid){
	  $pdid='1';
}elseif($act == 'z'){
	  $sex=$user[sex];
	  $pdid='z';
}elseif($act == 'showok'){
    	           $bzwjc=Bingz_upload('user/show/','1','1',$user_uid.'_');
    	           if($bzwjc[1] == '1'){
			  	    	     $tjts="上传成功！";
			  	    	     $show=authcode('data/user/show/'.$bzwjc[2],'ok');
  			             $db->update('user',array( 'show' => 'data/user/show/'.$bzwjc[2]),"`uid` = '$user_uid'");    			  	
    	           }else{
                     $tjts='上传失败<br/>原因：'.$bzwjc[2].'';
                 }
	  $pdid='showok';
}elseif($act == 'show'){
	  $pdid='show';
}elseif($act == 'zok'){
	  if(!$_POST[user_name]){
	  	  $_POST[user_name]=$user_namey;
	  }
    $db->update('user',array('sex' => $_POST[sex] ,'user_qm' => $_POST[user_qm],'name' => $_POST[user_name] )," `uid` ='$user_uid'");
	  $pdid='zok';
}elseif($act == 'm'){
	  $pdid='m';
}elseif($act == 'mok'){
	  $mm=user_mm($_POST[user_mm]);
	  $xmm=$_POST[user_xmm];
	  if(empty($_POST[user_mm]) or empty($_POST[user_xmm])){
		   $mmts='不能为空！';
	  }elseif(!$db->get_one('user'," `pass` = '$mm' and `uid` = '$user_uid' ",'')){
	  	 $mmts='原密码错误！';
	  }elseif($db->get_one('user'," `pass` = '$mm' and `uid` = '$user_uid' ",'')){
       $user_class->user_password($user_uid,$xmm,'你好！你的密码已经修改！请记注新密码！');
	  	 $mmts='修改成功！';
	  }
	  $pdid='mok';
}elseif($act == 'mb'){
	  if($pass=$db->get_one('user_pass'," `uid` ='$user_uid'",'')){
	  	 $name=$pass[name];
	  	 $mbts='1';
	  }
	  $pdid='mb';
}elseif($act == 'mbok'){
	  if(empty($_POST[name]) or empty($_POST[pass])){
		   $mmts='不能为空！';
	  }elseif(!$db->get_one('user_pass'," `uid` ='$user_uid'",'')){
	  	 $pass=md5($_POST[pass]);
	  	 $db->insert('user_pass',array('id ' => 'NULL' ,'uid' => $user_uid,'pass ' => $pass,'name ' => $_POST[name],'time_a ' => $time ));
	  	 $mmts='设置密保成功！';
	  }else{
	  	$passy=md5($_POST[passy]);
	  	if($mm=$db->get_one('user_pass'," `uid` ='$user_uid' and `pass` ='$passy' ",'')){
	  	   $pass=md5($_POST[pass]);
	  	   $db->update('user_pass',array('name' => $_POST[name] ,'pass' => $pass )," `id` ='$mm[id]'");
	  	   $mmts='新密保设置成功！';
      }else{
	  	   $mmts='原密保答案错误！';
	  	}
	  }
	  $pdid='mbok';
}elseif($act == 'zfm'){
	  if($pass=$db->get_one('user',"`renminbi_pass` > '0' and `uid` ='$user_uid'",'')){
	  	 $mbts='1';
	  }
	  $pdid='zfm';
}elseif($act == 'zfmok'){
	  $_POST[passy];
	  $pass=Bingz_renminbi_mm($_POST[pass]);
	  $passy=Bingz_renminbi_mm($_POST[passy]);
	  if(empty($_POST[pass])){
		   $mmts='不能为空！';
	  }elseif(!$db->get_one('user',"`renminbi_pass` > '0' and `uid` ='$user_uid'",'')){
	  	 $db->update('user',array('renminbi_pass' => $pass )," `uid` ='$user_uid'");
	  	 $mmts='支付密码设置成功！';
	  }else{
	  	if($mm=$db->get_one('user'," `uid` ='$user_uid' and `renminbi_pass` = '$passy' ",'')){
	  	   $db->update('user',array('renminbi_pass' => $pass )," `uid` ='$user_uid'");
	  	   $mmts='新支付密码设置成功！';
      }else{
	  	   $mmts='原支付密码错误！';
	  	}
	  }
	  $pdid='zfmok';
}
@include template('head');
@include template('user/user_ziliao');
@include template('foot');
?>